<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
</head>
<style>
    .btn{
        position: absolute;
        top: 200px;
        left: 50px;
    }
</style>
<body>
<div id="app">
    <template v-if="ok">
        <h1>Title</h1>
        <p>Paragraph 1</p>
        <p>Paragraph 2</p>
    </template>
    <button class="btn" @click='changeOk'>
        改变ok属性
    </button>
</div>
</body>
<script src="../vue.js"></script>
<script>
const rw = new Vue({
    el:"#app",
    data:{
        ok:false
    },
    methods:{
        changeOk: function(){
            return this.ok = !this.ok
        }
    }
})
</script>
</html>